<?php
	include "../head.php"
	// session_start()
?>
<head>
	<meta charset="utf-8">
	<title>YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证</title>
	<link rel="stylesheet" type="text/css" href="ucenter.css">
</head>
<!-------------左侧导航------------------>
<body>
<div id="left-top">
    <span><b size="15px">VIP：</b><?php echo $_SESSION['user']['username']; ?><br><b size="15px">欢迎回来!</b></span>
</div>
    <div id="left" class="sdmenu">
      <div class="collapsed">
        <span size="15px"><b>订单中心</b></span><br/><br/>
        <a href="./dingdan/index.php" name="order" value="order">我的订单</a><br/><br/>
		<a href="./dingdan/index.php" name="order" value="1">确认收货</a><br/><br/>
		
      </div>
      <div>
        <span size="15px"><b>服务中心</b></span><br/><br/>
        <a href="./do/index.php" name="action" value="action">我的信息</a><br/><br/>
        <a href="./do/lyb/index.php" name="lyb" value="lyb">留言板</a><br/><br/><br/><br/>       
      </div>
      <div>
        <span size="15px"><b>个人信息管理</b></span><br/><br/>	<a href="./solo/person.php">编辑个人资料</a><br/><br/>
        <a href="./picup.php">头像设置</a><br/><br/> 
        <a href="./solo/edit.php">地址管理</a><br/><br/> 
      </div>     
    </div>
<!----------------左侧导航--------------------->	
<!-------------右侧内容(如何进行局部跳转)----------------->	
	<center> 
	<div id="right">
		
	</div>
	</center>
<!------------右侧内容结束----------------->	
	<div id="bottom">
		<img src="hkinczio.jpg">
	</div>
</body>

<?php

	include("./dbconfig.php");
	include("../../../public/functions.php");
	
	$link = @mysqli_connect(HOST,USER,PASS) or die("数据库连接失败");
	mysqli_select_db($link,DBNAME);
	mysqli_set_charset($link,"utf8");
	
	$upfile = $_FILES['picname'];
	$path = "../../public/uploads";
	$typelist = array("image/png","image/jpeg","image/jpg","image/gif","image/pjpeg"); 
	
	switch($_GET['action']){
		case 'insert':
		 $picname = $upfile['name'];//上传图片的老名字
		 $picname= $uppic['info']; //存到数据里面的新名字
		 	$sql = "insert into goods(picname) values('$picname')";
			// echo $sql;die;
			$result = mysqli_query($link,$sql);
			
			//压缩图片
			imageZoom($picname,"../../public/uploads/",$width=40,$height=40,$pre="s_");
			
            if(mysqli_insert_id($link)>0){
                header("Location:ucenter.php");
				die;
            }else{
                echo "添加失败";
            }
           echo mysqli_error($link);
		break;
		case "update_order":
			$id = $_GET['id'];
			$sql = "update orders set status=3 where id=$id";
			$result = mysqli_query($link,$sql);
			header("Location:./dingdan/index.php");
			break;
		
		
		
	}